<!--
 * @Author: lixb
 * @Date: 2020-08-24 15:36:05
 * @LastEditTime: 2020-08-25 14:54:26
 * @Descripttion: 钉钉授权页面
-->
<template>
  <div class="app-container">
    <el-card class="box-card first-step">
      <p class="step">第一步</p>
      <p><img src="@/assets/img/dd.png" style="width: 30px;height: 30px;" /></p>
      <div class="text1">{{ isAuthorization ? '已完成绑定' : '钉钉绑定' }}</div>
      <el-button class="first-button" type="primary" @click="openAuthDrawer">
        {{ isAuthorization ? '重新授权绑定' : '马上授权绑定' }}
      </el-button>
    </el-card>
    <el-card class="box-card">
      <div class="step">第二步</div>
      <div class="text2">组织架构同步</div>
      <el-button
        :style="{ 'margin-top': isAuthorization ? '10px' : '48px' }"
        type="primary"
        :disabled="!authorizationStatus"
      >
        马上同步
      </el-button>
      <div v-if="isAuthorization">
        <el-divider></el-divider>
        <div style="color: #7F848B;font-size: 12px;">最后一次完成同步操作：2020-07-07 10:00:00</div>
      </div>
    </el-card>
    <Authorization :is-show="isShow" @closeAuthDrawer="closeAuthDrawer"></Authorization>
  </div>
</template>

<script>
  import Authorization from './Authorizationdd';
  export default {
    components: { Authorization },
    data() {
      return {
        authorizationStatus: false,
        isShow: false,
        isAuthorization: false, //钉钉的绑定状态 true为已绑定
      };
    },
    watch: {},
    methods: {
      openAuthDrawer() {
        this.isShow = true;
      },
      closeAuthDrawer() {
        this.isShow = false;
      },
    },
  };
</script>

<style lang="scss" scoped>
  .box-card {
    width: 312px;
    height: 202px;
    background: url('~@/assets/img/dd&weChatbgm.png');
    display: inline-block;
    margin-right: 30px;
    text-align: center;
    .text1 {
      color: #7f848b;
    }
    .text2 {
      color: #7f848b;
      margin-top: 30px;
    }
    .first-button {
      margin-top: 15px;
    }
    .second-button {
      margin-top: 55px;
    }
    .step {
      font-size: 16px;
      font-weight: bold;
      margin: auto;
    }
  }
</style>
